<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!-- 适配方法：媒体查询--弊端：增加页面http的请求次数，增加页面负担  viewport视口  width=device-width表示将布局视口设置成理想的视口  initial-scale表示初始缩放比例  1表示不缩放 user-scalable表示是否允许手动缩放页面，默认为yes-->
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>弹性布局</title>
    <style>
         div.box {
             width: 800px;
             height: 400px;
             background: palevioletred;
         }
    </style>

    <!-- 注意！！此处的js一定要放在heade里面 -->
    <script>

        // @media mediatype and|not|only(media feature) {
        //     CSS-Code;
        // }

        if(window.screen.width>=1680) {//分辨率
            document.write('<link rel="stylesheet" href="css/index_1920.css">' );
        }
        else if (window.screen.width>=1600) {
            document.write('<link rel="stylesheet" href="css/index_1600.css">' );
        }else {
            document.write('<link rel="stylesheet" href="css/index.css">' );            
        }
    </script>
</head>
<body>
    <div class="box">

    </div>

    
</body>
</html>